﻿using GraphProcessor;
using IQIGame.Onigao.Logic;
using UnityEngine;

namespace IQIGame.Onigao.GamePlay.Editors
{
    [System.Serializable, NodeMenuItem(LevelEditorConst.Level + "/" + LevelEditorConst.Trigger + "/" + LevelEditorConst.MoveInRange, typeof(LevelServiceGraph))]
    public class LevelServiceTriggerNode_MoveInRange : LevelServiceTriggerNode
    {
        protected override ServiceTriggerType triggerType => ServiceTriggerType.MoveInRange;

        protected override string triggerName => LevelEditorConst.MoveInRange;
        [InspectorName("范围半径(cm)")]
        public int range;
        [LevelServiceEditorCustomProperty(ServiceTriggerType.MoveInRange, "触发类型")]
        public int rangeTriggerType;
        
        protected override LevelServiceCustomConfig CreateConfig()
        {
            return new LevelServiceTriggerCustom_MoveInRange()
            {
                range = this.range,
                rangeTriggerType = this.rangeTriggerType
            };
        }
    }
}